package com.woniu.command.workingProcedureTypeCommand;

import com.woniu.command.Command;
import com.woniu.command.handler.WorkingProcedureTypeCommandHandler;
import com.woniu.outlet.po.WorkingProcedureTypePo;
import com.woniu.utils.ApplicationContextHolder;

public class AddWorkingProcedureTypeCommand implements Command<WorkingProcedureTypePo,Integer> {

    private WorkingProcedureTypeCommandHandler handler;

    public  AddWorkingProcedureTypeCommand( ){
        //ApplicationContextHolder.getApplicationContext()拿到ApplicationContext
        this.handler = ApplicationContextHolder.getApplicationContext()
                .getBean(WorkingProcedureTypeCommandHandler.class);
    }

    @Override
    public Integer  execute(WorkingProcedureTypePo workingProcedureTypePo) {
        return this.handler.addWorkingProcedureType(workingProcedureTypePo);
    }
}
